<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/5/30
  Time: 11:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <%
      String pageTitle = "this is page title";
      request.setAttribute("pageTitle",pageTitle); //往这里存值才能在EL表达式中获取
    %>
    <%-- EL表达式中是可以直接使用隐式对象的 request response pageContext 等等 --%>
    <title>${pageTitle}</title>
  </head>
  <body>
  ${"this is EL string"}

  <% //这里的代码在service中执行
    System.out.println("hello jsp page");
    //int i = 5;
    String contextPath = request.getContextPath();
    out.print(contextPath);
  %>

  <%! //这里定义全局的变量
    int i = 3;
  %>
  <%-- 定义的代码在service方法中，out.print("hello");输出到页面上 --%>
  <%= //这个最后输出
  "hello"
  %>
  <%
    response.getWriter().write("response......."); //这个先执行
    response.getWriter().write("<br>");
    response.getWriter().write(i+"");
    response.getWriter().write("<br>");
  %>
  </body>
</html>
